class ViewRect {
	public x:number = 0;
	public y:number = 0;
	public width:number = 0;
	public height:number = 0;

	public constructor(x:number=0,y:number=0,width:number=0,height:number=0,){
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
	}
	public getOrigin():ViewPoint{
		let point = new ViewPoint();
		point.x = this.x;
		point.y = this.y;
		return point;
	}
	public getCenter():ViewPoint{
		let point = new ViewPoint();
		point.x = this.x+this.width/2;
		point.y = this.y+this.height/2;
		return point;
	}
	public getSize():ViewSize{
		let size = new ViewSize();
		size.width = this.width;
		size.height = this.height;
		return size;
	}
}